package TraLaLa.Servidor;

import java.rmi.Naming;

public class MainServer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		if (args.length < 3) {
			System.out.println("uso: java [policy] [codebase] servidor.Servidor [host] [port] [server]");
			System.exit(0);
		}

		//if (System.getSecurityManager() == null) {
			//System.setSecurityManager(new RMISecurityManager());
		//}

		String name = "//" + args[0] + ":" + args[1] + "/" + args[2];

		try {
			ServiceFacade facade = new ServiceFacade();
			Naming.rebind(name, facade);
			System.out.println("Servidor '" + name + "' active and waiting...");
		} catch (Exception e) {
			System.err.println("Error!: " + e.getMessage());
			e.printStackTrace();
		}

	}

}
